package Stream;

import java.io.InputStream;
import java.util.stream.Stream;

public class Stream4 {
    public static void main(String[] args) {
        Stream<String> stream = Stream.of("1","2","3","4");
        //使用map方法
        Stream<Integer> stream2 = stream.map((String s)->{
            return Integer.parseInt(s);
            //将s转化为整数
        });
        stream2.forEach(i-> System.out.println(i));
    }
}
